home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Full / NetObjects Fusion 9 Standard / NOF9_Full_EN.exe / data1.cab / FSI / lib / nof / Image.js < prev    next >
Encoding:
Text File  |  2005-11-16  |  2.5 KB  |  98 lines

  1. /****i* SOURCE_FILE/INFO
  2.     *
  3.     * NAME
  4.     *  Image.js
  5.     *
  6.     * USAGE
  7.     *  Part of Netobjects JavaScript Library.
  8.     *
  9.     * COPYRIGHT
  10.     *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.     *  All Rights Reserved.
  12.     *
  13.     *  This is an unpublished work protected by Website Pros, Inc.
  14.     *  as a trade secret, and is not to be used or disclosed except as
  15.     *  expressly provided in a written license agreement executed by
  16.     *  you and Website Pros, Inc.
  17.     *
  18.     *      <copyright@websitepros.com>
  19.     *
  20.     * NOTES
  21.     *  JavaScript code.
  22.     *
  23.     *****/
  24. if (!IS.isModuleInitialized("IS.NOF.Image"))
  25. {
  26.     /****h* NOF_JavaScript_Library/NOF.Image
  27.     *
  28.     * NAME
  29.     *  NOF.Image
  30.     *
  31.     * DESCRIPTION
  32.     *  
  33.     *    External dependencies: NOF.ImageAttributes
  34.     ****/
  35.     
  36.     /**
  37.     * Constructor    
  38.     * @param title
  39.     * @param description
  40.     * @param imagePath
  41.     * @param rotation
  42.     * @param displayAttrs 
  43.     * @param indexAttrs
  44.     **/
  45.     function NOF_Image( title, description, imagePath, rotation, displayAttrs, indexAttrs ) {
  46.         
  47.         this.__proto__ = NOF_Image.prototype;
  48.         
  49.         this.title        = arguments.length > 0 ? arguments[0] : '';
  50.         this.description  = arguments.length > 1 ? arguments[1] : '';
  51.         this.imagePath    = arguments.length > 2 ? arguments[2] : '';
  52.         this.rotation        = arguments.length > 3 ? arguments[3] : 0; 
  53.         this.displayAttrs = arguments.length > 4 ? arguments[4] : null;
  54.         this.indexAttrs   = arguments.length > 5 ? arguments[5] : null;
  55.         
  56.         if (this.displayAttrs == null)
  57.             this.displayAttrs = new NOF.ImageAttributes();
  58.         if (this.indexAttrs == null)
  59.             this.indexAttrs = new NOF.ImageAttributes();
  60.         
  61.     }
  62.     
  63.     {
  64.         
  65.         var method = NOF_Image.prototype;
  66.         /*
  67.         equal;
  68.         clone;
  69.         toString;
  70.         */
  71.         
  72.         method.equal     = function (o) {
  73.             return ( this.title == o.title
  74.                 && this.description == o.description
  75.                 && this.imagePath == o.imagePath            
  76.                 && this.rotation == o.rotation
  77.                 && this.displayAttrs.equal(o.displayAttrs)
  78.                 && this.indexAttrs.equal(o.indexAttrs));
  79.         }
  80.         
  81.         method.clone    = function () {
  82.             return new NOF.Image(this.title, this.description, 
  83.                 this.imagePath, this.rotation, this.displayAttrs.clone(), this.indexAttrs.clone());
  84.         }
  85.         
  86.         method.toString = function () {
  87.             return ' title = ' + this.title + 
  88.                 ', description = ' + this.description +
  89.                 ', path = ' + this.imagePath + 
  90.                 ', rotation = ' + this.rotation + 
  91.                 ', DisplayAttrs :: ' + this.displayAttrs.toString() +
  92.                 ', IndexAttrs :: ' + this.indexAttrs.toString();
  93.         }    
  94.     }    
  95.     
  96.     NOF.__proto__.Image = NOF_Image;    
  97.     
  98. }